package com.ydj.app.controller;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.ydj.app.entity.WebUser;
import com.ydj.app.protocol.http.web.WebBannerListRes;
import com.ydj.app.service.BannerService;
import com.ydj.framework.annotation.AllowGuest;
import com.ydj.framework.exception.CommonException;
import com.ydj.framework.protocol.JsonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

@RestController
@RequestMapping("/web/banner")
@Api(tags = "WEB-Banner")
public class WebBannerController {

    @Autowired
    private BannerService bannerService;

    @AllowGuest
    @ResponseBody
    @ApiOperation(value = "首页，获取banner轮播")
    @ApiOperationSupport(order = 10)
    @PostMapping(value = "/list")
    public JsonResult<WebBannerListRes> list(@ApiIgnore WebUser webUser) throws CommonException {
        WebBannerListRes res = bannerService.webList(webUser);
        return JsonResult.success(res);
    }

}